﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/AdminPage.master" AutoEventWireup="true" CodeFile="Mail_Add.aspx.cs" Inherits="Admin_Mail_Add" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="head">
        <strong>
    <asp:Label ID="Label1" runat="server" Font-Bold="True" ForeColor="White" 
        Text="Add New Mail"></asp:Label>
        </strong>
    </div>

    <table style="width: 100%">
        <tr>
            <td style="width: 94px">
                <strong></strong></td>
            <td class="style9" style="width: 189px">
                &nbsp;</td>
            <td style="width: 106px">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                <strong></strong></td>
        </tr>
        <tr>
            <td style="font-weight: bold; width: 94px">
                <strong>ID Mail</strong></td>
            <td class="style9" style="width: 189px">
                <asp:Label ID="lbIDMail" runat="server" Font-Bold="True"></asp:Label>
            </td>
            <td style="width: 106px; font-weight: bold">
                <strong>Branch receive</strong></td>
            <td>
                <strong>
                <asp:DropDownList ID="ddlBranch" runat="server" DataSourceID="SqlDataSource5" 
                    DataTextField="BranchName" DataValueField="BranchID">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                    SelectCommand="SELECT * FROM [Branch]"></asp:SqlDataSource>
                </strong>
            </td>
            <td>
                <strong></strong></td>
        </tr>
        <tr>
            <td style="font-weight: bold; width: 94px">
                <strong>Sender Name</strong></td>
            <td class="style9" style="width: 189px">
                <strong>
                <asp:TextBox ID="txtSName" runat="server" Width="150px" MaxLength="50"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="txtSName" 
                    ErrorMessage="You did not enter a valid sender name" ForeColor="Red" 
                    SetFocusOnError="True" ValidationGroup="Add">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="txtSName" 
                    ErrorMessage="You did not enter a valid sender name" ForeColor="Red" 
                    SetFocusOnError="True" ValidationExpression="[A-Z]{1}[a-zA-Z ]{4,45}" 
                    ValidationGroup="Add">*</asp:RegularExpressionValidator>
                </strong>
            </td>
            <td style="width: 106px; font-weight: bold">
                <strong>Receiver Name</strong></td>
            <td>
                <strong>
                <asp:TextBox ID="txtRName" runat="server" Width="150px" MaxLength="50"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ControlToValidate="txtRName" 
                    ErrorMessage="You did not enter a valid receiver name" ForeColor="Red" 
                    SetFocusOnError="True" ValidationGroup="Add">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                    ControlToValidate="txtRName" 
                    ErrorMessage="You did not enter a valid receiver name" ForeColor="Red" 
                    SetFocusOnError="True" ValidationExpression="[A-Z]{1}[a-zA-Z ]{4,45}" 
                    ValidationGroup="Add">*</asp:RegularExpressionValidator>
                </strong>
            </td>
            <td>
                <strong></strong></td>
        </tr>
        <tr>
            <td style="font-weight: bold; width: 94px">
                &nbsp;</td>
            <td class="style9" style="width: 189px">
                <asp:Label ID="Label2" runat="server" Font-Size="X-Small" 
                    Text="Sender name need 5 characters. "></asp:Label>
            </td>
            <td style="width: 106px; font-weight: bold">
                &nbsp;</td>
            <td>
                <asp:Label ID="Label3" runat="server" Font-Size="Small" 
                    style="font-size: x-small" Text="Receiver name need 5 characters. "></asp:Label>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 94px" valign="top">
                <strong>Sender Address</strong></td>
            <td class="style9" style="width: 189px" valign="top">
                <strong>
                <asp:TextBox ID="txtSAddress" runat="server" Rows="4" TextMode="MultiLine" 
                    Width="150px" MaxLength="500"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ControlToValidate="txtSAddress" 
                    ErrorMessage="You did not enter a valid sender address" ForeColor="Red" 
                    SetFocusOnError="True" ValidationGroup="Add">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
                    ControlToValidate="txtSAddress" 
                    ErrorMessage="You did not enter a valid sender address" ForeColor="Red" 
                    SetFocusOnError="True" ValidationExpression="[a-zA-Z0-9\s\,\''\-\.]*" 
                    ValidationGroup="Add">*</asp:RegularExpressionValidator>
                </strong>
            </td>
            <td style="width: 106px; font-weight: bold" valign="top">
                <strong>Receiver Address</strong></td>
            <td valign="top">
                <strong>
                <asp:TextBox ID="txtRAddress" runat="server" Rows="4" TextMode="MultiLine" 
                    Width="150px" MaxLength="500"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                    ControlToValidate="txtRAddress" 
                    ErrorMessage="You did not enter a valid receiver address" ForeColor="Red" 
                    SetFocusOnError="True" ValidationGroup="Add">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" 
                    ControlToValidate="txtRAddress" 
                    ErrorMessage="You did not enter a valid receiver address" ForeColor="Red" 
                    SetFocusOnError="True" ValidationExpression="[a-zA-Z0-9\s\,\''\-\.]*" 
                    ValidationGroup="Add">*</asp:RegularExpressionValidator>
                </strong>
            </td>
            <td>
                <strong></strong></td>
        </tr>
        <tr>
            <td style="width: 94px">
                <strong>Sender Phone</strong></td>
            <td class="style9" style="width: 189px">
                <strong>
                <asp:TextBox ID="txtSPhone" runat="server" Width="150px" MaxLength="20"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                    ControlToValidate="txtSPhone" 
                    ErrorMessage="You did not enter a valid sender phone" ForeColor="Red" 
                    SetFocusOnError="True" ValidationGroup="Add">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                    ControlToValidate="txtSPhone" 
                    ErrorMessage="You did not enter a valid sender phone" ForeColor="Red" 
                    SetFocusOnError="True" ValidationExpression="[0-9]{1}[0-9]{6,19}" 
                    ValidationGroup="Add">*</asp:RegularExpressionValidator>
                </strong></td>
            <td style="width: 106px">
                <strong>Receiver Phone</strong></td>
            <td>
                <strong>
                <asp:TextBox ID="txtRPhone" runat="server" Width="150px" MaxLength="20"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                    ControlToValidate="txtRPhone" 
                    ErrorMessage="You did not enter a valid receiver phone" ForeColor="Red" 
                    SetFocusOnError="True" ValidationGroup="Add">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" 
                    ControlToValidate="txtRPhone" 
                    ErrorMessage="You did not enter a valid receiver phone" ForeColor="Red" 
                    SetFocusOnError="True" ValidationExpression="[0-9]{1}[0-9]{6,19}" 
                    ValidationGroup="Add">*</asp:RegularExpressionValidator>
                </strong></td>
            <td>
                <strong></strong></td>
        </tr>
        <tr>
            <td style="width: 94px">
                &nbsp;</td>
            <td class="style9" style="width: 189px">
                <asp:Label ID="Label4" runat="server" Font-Size="X-Small" 
                    Text="Include 7 digits for phone number"></asp:Label>
            </td>
            <td style="width: 106px">
                &nbsp;</td>
            <td>
                <asp:Label ID="Label5" runat="server" Font-Size="X-Small" 
                    Text="Include 7 digits for phone number"></asp:Label>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 94px">
                <strong>Sender Email</strong></td>
            <td class="style9" style="width: 189px">
                <strong>
                <asp:TextBox ID="txtSEmail" runat="server" Width="150px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                    ControlToValidate="txtSEmail" 
                    ErrorMessage="You did not enter a valid sender email" ForeColor="Red" 
                    SetFocusOnError="True" ValidationGroup="Add">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator7" runat="server" 
                    ControlToValidate="txtSEmail" 
                    ErrorMessage="You did not enter a valid sender address" ForeColor="Red" 
                    SetFocusOnError="True" 
                    ValidationExpression="[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+" 
                    ValidationGroup="Add">*</asp:RegularExpressionValidator>
                </strong></td>
            <td style="width: 106px">
                <strong>Recevier ZipCode</strong></td>
            <td>
                <strong>
                <asp:TextBox ID="txtZipCode" runat="server" Width="150px" MaxLength="20"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" 
                    ControlToValidate="txtZipCode" ErrorMessage="You did not enter a valid ZipCode" 
                    ForeColor="Red" SetFocusOnError="True" ValidationGroup="Add">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator8" runat="server" 
                    ControlToValidate="txtZipCode" 
                    ErrorMessage="You did not enter a valid Zip Code" ForeColor="Red" 
                    SetFocusOnError="True" ValidationExpression="\d{5}([\-]\d{4})?" 
                    ValidationGroup="Add">*</asp:RegularExpressionValidator>
                <asp:HyperLink ID="HyperLink1" runat="server" Font-Underline="True" 
                    ForeColor="Blue">Find ZipCode</asp:HyperLink>
                </strong></td>
            <td>
                <strong></strong></td>
        </tr>
        <tr>
            <td style="width: 94px">
                &nbsp;</td>
            <td class="style9" style="width: 189px">
                &nbsp;</td>
            <td style="width: 106px">
                &nbsp;</td>
            <td>
                <asp:Label ID="Label6" runat="server" Font-Size="X-Small" 
                    Text="Include 5 digits for ZipCode"></asp:Label>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 94px">
                <strong>Type of mail</strong></td>
            <td class="style9" style="width: 189px">
                <strong>
                <asp:DropDownList ID="ddlTOMail" runat="server" DataSourceID="SqlDataSource1" 
                    DataTextField="MTypeName" DataValueField="MTypeID">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                    SelectCommand="SELECT * FROM [TypeofMail]"></asp:SqlDataSource>
                </strong></td>
            <td style="width: 106px">
                <strong>Type of deliver</strong></td>
            <td>
                <strong>
                <asp:DropDownList ID="ddlTODeliver" runat="server" DataSourceID="SqlDataSource3" 
                    DataTextField="DTypeName" DataValueField="DTypeID">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                    SelectCommand="SELECT * FROM [TypeofDeliver]"></asp:SqlDataSource>
                </strong></td>
            <td>
                <strong></strong></td>
        </tr>
        <tr>
            <td style="width: 94px">
                <strong>Distance of mail</strong></td>
            <td class="style9" style="width: 189px">
                <strong>
                <asp:DropDownList ID="ddlDOMail" runat="server" DataSourceID="SqlDataSource2" 
                    DataTextField="Distance" DataValueField="DistanceID">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                    
                    SelectCommand="SELECT [DistanceID], [Distance], [DistanceCharge] FROM [DistanceofMail]"></asp:SqlDataSource>
                </strong></td>
            <td style="width: 106px">
                <strong>Weight of mail</strong></td>
            <td>
                <strong>
                <asp:DropDownList ID="ddlWOMail" runat="server" DataSourceID="SqlDataSource4" 
                    DataTextField="Weight" DataValueField="WeightID">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                    SelectCommand="SELECT * FROM [WeightofMail]"></asp:SqlDataSource>
                </strong></td>
            <td>
                <strong></strong></td>
        </tr>
        <tr>
            <td style="width: 94px">
                <strong>Date Receipt</strong></td>
            <td class="style9" style="width: 189px">
                <strong>
                <asp:Label ID="lbDateReceipt" runat="server" onload="lbDateReceipt_Load"></asp:Label>
                </strong></td>
            <td style="width: 106px">
                <strong>Total Fee</strong></td>
            <td>
                <strong>
                <asp:Label ID="lbTotalFee" runat="server" Text="0"></asp:Label>
                VND</strong></td>
            <td>
                <strong></strong></td>
        </tr>
        <tr>
            <td style="width: 94px">
                <strong></strong></td>
            <td class="style9" style="width: 189px">
                <strong></strong></td>
            <td style="width: 106px">
                <strong></strong></td>
            <td>
                <asp:ImageButton ID="ImageButton1" runat="server" 
                    ImageUrl="~/images/iconcal.png" onclick="ImageButton1_Click" />
            </td>
            <td>
                <strong></strong></td>
        </tr>
        <tr>
            <td style="width: 94px">
                &nbsp;</td>
            <td class="style9" colspan="3">
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red" 
                    ValidationGroup="Add" />
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td align="center" colspan="5" class="TagCloudLinkContainer_1">
                <asp:ImageButton ID="imgbAdd" runat="server" ImageUrl="~/images/img_Add.png" 
                    onclick="imgbAdd_Click" ValidationGroup="Add" />
                <asp:ImageButton ID="imgbReset" runat="server" 
                    ImageUrl="~/images/img_Reset.png" onclick="ImageButton3_Click" />
                <asp:ImageButton ID="imgbBack" runat="server" 
                    ImageUrl="~/images/img_Back.png" 
                    PostBackUrl="~/Admin/Mail_Management.aspx" />
            </td>
        </tr>
        <tr>
            <td style="width: 94px">
                <strong></strong></td>
            <td class="style9" style="width: 189px">
                <strong></strong></td>
            <td style="width: 106px">
                <strong></strong></td>
            <td>
                &nbsp;</td>
            <td>
                <strong></strong></td>
        </tr>
    </table>

</asp:Content>

